var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function (req, res, next) {
  res.send({ succcess: "请求成功" })

});

// 列表接口
router.post("/list", function (req, res) {
  var arr = ["暂无数据"]
  if (req.body.searchText == "衣服") {
    arr = ["nike", "安踏", "李宁"]
  } else if (req.body.searchText == "汽车") {
    arr = ["比亚迪", "长安", "长城"]
  } else if (req.body.searchText == "手机") {
    arr = ["vivo", "oppo", "步步高"]
  }
  res.send(arr)
})
module.exports = router;
